;; 测试shepherd-nonroot服务



(use-modules
 (gnu)
 (gnu packages)
 (gnu packages bash)
 (gnu packages busybox)
 (gnu services base)
 (gnu services ssh)
 (gnu services databases)
 (gnu services web)
 (luhux services shepherd)
 )


(operating-system
  (host-name "testshepherdnonroot")
  (timezone "UTC")
  (locale "en_US.utf8")

  
  ;; 引导(忽略)
  (bootloader (bootloader-configuration
	       (bootloader grub-bootloader)
	       (target "does-not-matter")))
  
    ;; 文件系统(忽略)
  (file-systems (list (file-system
			(device "does-not-matter")
			(mount-point "/")
			(type "does-not-matter"))))

  ;; 账户
  (users
   (append
    (list
     (user-account
      (name "simple")
      (comment "user")
      (group "users")
      )
     )
    %base-user-accounts))

  ;; 全局安装的包
  (packages
   (map
    specification->package
    (list
     ;; shell
     "bash"
     
     ;; 工具集
     "busybox"

     ;; ssl证书
     "nss-certs"
     )
    )
   )

  ;; 服务
  (services
   (list

    ;; 脚本兼容
    (service special-files-service-type
	     `(("/bin/sh" ,(file-append bash "/bin/sh"))
	       ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))

    ;; log 记录服务
    (syslog-service)

    ;; 网络
    (service static-networking-service-type
	     (list (static-networking (interface "lo")
				      (ip "127.0.0.1")
				      (requirement '())
				      (provision '(loopback networking)))))

    (service shepherd-nonroot-service-type
	     (shepherd-nonroot-configuration
	      (user "simple")
	      (group "users")
	      (socket "/tmp/shepherd.socket")
	      (log "/tmp/shepherd.log")
	      (config "/tmp/init.scm")))
    )
   )
  )
